import { g, r } from '@/router/generator'
import Layout from '@/layout'

export default [

  // Store manage
  {
    path: '/store', name: 'StoreManage', component: Layout,
    meta: { title: '门店管理', icon: 'el-icon-s-home', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Store', '门店列表'),
      ...r('Region', '地区'),
      ...g('Order', '订单列表'),
      // ...r('OrderItem', '订单明细'),
      ...r('Printer', '小票机'),
      ...r('Invoice', '支付凭证')
    ]
  },

  // Product manage
  {
    path: '/product', name: 'ProductManage', component: Layout,
    meta: { title: '产品管理', icon: 'el-icon-goods', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Category', '产品分类'),
      ...r('TagCategory', '标签分类'),
      ...r('Tag', '产品标签'),
      ...g('Product', '产品列表'),
      ...g('ExchangeProduct', '换购产品'),
      // ...g('Specification', '规格'),
      ...r('StoreSpecification', '店铺销售产品')
    ]
  },

  {
    path: '/content', name: 'ContentManage', component: Layout,
    meta: { title: '教程管理', icon: 'el-icon-video-camera', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('VideoCategory', '分类'),
      ...r('Video', '教程')
      // ...g('Specification', '规格'),
      // ...r('StoreProduct', '店铺销售产品')
    ]
  },

  // Promotion manage
  {
    path: '/promotion', name: 'PromotionManage', component: Layout,
    meta: { title: '活动管理', icon: 'el-icon-sugar', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Promotion', '活动设置'),
      ...r('PromotionTemplate', '促销模板设置')
    ]
  },

  // Coupon manage
  {
    path: '/coupon', name: 'CouponManage', component: Layout,
    meta: { title: '优惠券管理', icon: 'el-icon-s-ticket', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Coupon', '优惠券设置'),
      ...r('UserCoupon', '用户优惠券')
    ]
  },

  // User manage
  {
    path: '/user', name: 'UserManage', component: Layout,
    meta: { title: '会员管理', icon: 'el-icon-user', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('UserLevel', '会员等级'),
      ...g('User', '会员'),
      ...r('Balance', '会员积分'),
      ...r('BalanceLog', '积分记录')
    ]
  },

  // System manage
  {
    path: '/system', name: 'SystemManage', component: Layout,
    meta: { title: '首页模块', icon: 'el-icon-setting', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Type', '词汇表'),
      ...r('Album', '图片模块'),
      ...r('ProductShow', '首页产品'),
      ...r('Notice', '通知'),
      ...r('User', '用户管理'),
      // ...r('Video', '视频'),
      // ...r('Content', '文章内容')
      // ...r('Picture', '图片'),
      ...r('Option', '配置')
    ]
  },

  // 门店菜单

  {
    path: '/system', name: 'SystemManage', component: Layout,
    meta: { title: '门店管理', icon: 'el-icon-setting', roles: ['ROLE_STORE'] },
    children: [
      ...r('StoreProduct', '门店产品'),
      ...r('StoreOrder', '门店订单'),
      ...r('StoreAlbum', '首页图片'),
      ...r('StoreProductShow', '首页产品'),
      ...r('StoreNotice', '通知')
    ]
  }
]
